package com.logica.tutorial.web;

import java.util.ArrayList;
import java.util.List;

import org.apache.wicket.extensions.ajax.markup.html.tabs.AjaxTabbedPanel;
import org.apache.wicket.extensions.markup.html.tabs.AbstractTab;
import org.apache.wicket.markup.html.WebPage;
import org.apache.wicket.markup.html.panel.Panel;
import org.apache.wicket.model.Model;

@SuppressWarnings("serial")
public class TabbedPanelPage extends WebPage {

	@SuppressWarnings("unchecked")
	public TabbedPanelPage() {
	  List<AbstractTab> tabs = new ArrayList<AbstractTab>();
	  tabs.add(new AbstractTab(new Model("Add")) {
		  public Panel getPanel(String panelId) {
			  return new HomePage(panelId);
		  }
	  });

	  tabs.add(new AbstractTab(new Model("Search")) {
		  public Panel getPanel(String panelId) {
			  return new SearchPage(panelId);
		  }
	  });
	  
	  AjaxTabbedPanel ajaxTabbedPanel = new AjaxTabbedPanel("tabs", tabs);
	  add(ajaxTabbedPanel);
	}
}
